import _Row from "choerodon-ui/lib/row";
import _TextField from "choerodon-ui/pro/lib/text-field";
import _Lov from "choerodon-ui/pro/lib/lov";
import _Button from "choerodon-ui/pro/lib/button";
import _Col from "choerodon-ui/lib/col";
import _Form from "choerodon-ui/pro/lib/form";
import _Select from "choerodon-ui/pro/lib/select";
import _Table from "choerodon-ui/pro/lib/table";
import _Modal from "choerodon-ui/pro/lib/modal";
import _regeneratorRuntime from "@babel/runtime/regenerator";
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
import _Tag from "choerodon-ui/lib/tag";
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
import _createClass from "@babel/runtime/helpers/esm/createClass";
import _inherits from "@babel/runtime/helpers/esm/inherits";
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
import _applyDecoratedDescriptor from "@babel/runtime/helpers/esm/applyDecoratedDescriptor";
import _DataSet from "choerodon-ui/pro/lib/data-set";

var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _dec13, _class, _class2;

/**
 * @since 2019-12-20
 */
import React from 'react';
import { withRouter } from 'dva/router';
import { Bind } from 'lodash-decorators';
import queryString from 'query-string';
import { Button as ButtonPermission } from 'components/Permission';
import { Header, Content } from 'components/Page';
import intl from 'utils/intl';
import withProps from 'utils/withProps';
import notification from 'utils/notification';
import { operatorRender } from 'utils/renderer';
import formatterCollections from 'utils/intl/formatterCollections';
import { checkStatusFormConfigDS, searchFormConfigDS, tableConfigDS, permissionSetDS, clearPermissionRecordFormDS } from "../../stores/missPermissionRecordDS";
import { clearPermissionRecordInterface, refreshPermissionSet, refreshMenuPermissionSet, patchAddPermissionInterface } from "../../services/missPermissionRecordService";
import styles from "./index.less?modules";
var MissPermissionRecord = (_dec = formatterCollections({
  code: ['ciam.missPermission']
}), _dec2 = withProps( // checkStatusFormDS 注入 到 this.porps
function () {
  var checkStatusFormDS = new _DataSet(checkStatusFormConfigDS);
  var searchFormDS = new _DataSet(searchFormConfigDS);
  var tableDS = new _DataSet(tableConfigDS(checkStatusFormDS, searchFormDS));
  checkStatusFormDS.buttonRefreshFlag = true;
  checkStatusFormDS.buttonAddPermissionFlag = false;
  checkStatusFormDS.buttonMenuRefreshFlag = false;
  return {
    checkStatusFormDS: checkStatusFormDS,
    searchFormDS: searchFormDS,
    tableDS: tableDS
  };
}, {
  cacheState: true
}), _dec3 = Bind(), _dec4 = Bind(), _dec5 = Bind(), _dec6 = Bind(), _dec7 = Bind(), _dec8 = Bind(), _dec9 = Bind(), _dec10 = Bind(), _dec11 = Bind(), _dec12 = Bind(), _dec13 = Bind(), withRouter(_class = _dec(_class = _dec2(_class = (_class2 = /*#__PURE__*/function (_React$Component) {
  _inherits(MissPermissionRecord, _React$Component);

  var _super = _createSuper(MissPermissionRecord);

  function MissPermissionRecord(props) {
    var _this;

    _classCallCheck(this, MissPermissionRecord);

    _this = _super.call(this, props);
    _this.permissionSetDS = new _DataSet(permissionSetDS);
    _this.clearPermissionRecordFormDS = new _DataSet(clearPermissionRecordFormDS);
    _this.state = {
      moreSearchFlag: false,
      buttonRefreshFlag: null,
      buttonAddPermissionFlag: null,
      buttonMenuRefreshFlag: null
    };
    return _this;
  }

  _createClass(MissPermissionRecord, [{
    key: "componentDidMount",
    value: function componentDidMount() {
      var _this$props$checkStat = this.props.checkStatusFormDS,
          buttonAddPermissionFlag = _this$props$checkStat.buttonAddPermissionFlag,
          buttonRefreshFlag = _this$props$checkStat.buttonRefreshFlag,
          buttonMenuRefreshFlag = _this$props$checkStat.buttonMenuRefreshFlag;
      this.setState({
        buttonRefreshFlag: buttonRefreshFlag,
        buttonAddPermissionFlag: buttonAddPermissionFlag,
        buttonMenuRefreshFlag: buttonMenuRefreshFlag
      });
    } // 添加权限集列

  }, {
    key: "permissionSetColumns",
    get: function get() {
      return [{
        name: 'code',
        width: 280
      }, {
        name: 'name'
      }, {
        name: 'levelMeaning',
        width: 100
      }, {
        name: 'parentName'
      }];
    } // 缺失权限管理页面Table列

  }, {
    key: "columns",
    get: function get() {
      var _this2 = this;

      var path = this.props.match.path;
      return [{
        name: 'apiPath',
        width: 310
      }, {
        width: 100,
        name: 'apiMethodMeaning'
      }, {
        name: 'permissionCode',
        width: 295
      }, {
        name: 'handleStatusMeaning',
        width: 100,
        renderer: function renderer(_ref) {
          var value = _ref.value,
              record = _ref.record;

          var _record$toData = record.toData(),
              _record$toData$handle = _record$toData.handleStatus,
              handleStatus = _record$toData$handle === void 0 ? null : _record$toData$handle;

          if (!handleStatus) {
            return;
          }

          return handleStatus === 'PROCESSED' ? /*#__PURE__*/React.createElement(_Tag, {
            color: "green"
          }, value) : /*#__PURE__*/React.createElement(_Tag, {
            color: "magenta"
          }, value);
        }
      }, {
        name: 'serviceName',
        width: 200
      }, {
        name: 'menuName',
        width: 100
      }, {
        name: 'levelMeaning',
        width: 100
      }, {
        name: 'permissionType'
      }, {
        name: 'creationDate',
        width: 160
      }, {
        header: intl.get('cpaas.common.table.column.option').d('操作'),
        width: 70,
        renderer: function renderer(_ref2) {
          var record = _ref2.record;
          var actions = [];
          actions = [{
            ele: /*#__PURE__*/React.createElement(ButtonPermission, {
              type: "text",
              permissionList: [{
                code: "".concat(path, ".button.detail"),
                type: 'button',
                meaning: '缺失权限-详情'
              }],
              onClick: function onClick() {
                return _this2.handleDetail(record);
              }
            }, intl.get('cpaas.common.button.detail').d('详情')),
            key: 'detail',
            len: 2,
            title: intl.get('cpaas.common.button.detail').d('详情')
          }];
          return operatorRender(actions);
        },
        lock: 'right',
        align: 'left'
      }];
    }
    /**
     * 跳转详情页
     */

  }, {
    key: "handleDetail",
    value: function handleDetail(record) {
      var _record$toData2 = record.toData(),
          _record$toData2$permi = _record$toData2.permissionCheckId,
          permissionCheckId = _record$toData2$permi === void 0 ? '' : _record$toData2$permi;

      var _this$props = this.props,
          history = _this$props.history,
          search = _this$props.location.search,
          match = _this$props.match;

      var _queryString$parse = queryString.parse(search.substring(1)),
          accessToken = _queryString$parse.access_token;

      var router = {
        pathname: match.path.indexOf('/private') === 0 ? "/private/ciam/miss-permission-record/detail/".concat(permissionCheckId) : "/ciam/miss-permission-record/detail/".concat(permissionCheckId),
        search: match.path.indexOf('/private') === 0 ? "?access_token=".concat(accessToken) : ''
      };
      history.push(router);
    }
    /**
     * 批量添加权限
     */

  }, {
    key: "handlePatchAddPermissionSet",
    value: function handlePatchAddPermissionSet() {
      var tableDS = this.props.tableDS;

      if (tableDS.selected.length !== 0) {
        var processedFlag = tableDS.selected.map(function (item) {
          return item.toData().handleStatus;
        }).includes('PROCESSED');

        if (!processedFlag) {
          var levelSet = tableDS.selected.map(function (item) {
            return item.toData().fdLevel;
          });
          var level = levelSet[0];
          var tempFlag = levelSet.every(function (item) {
            return item === level;
          });

          if (tempFlag) {
            var permissionCodes = tableDS.selected.map(function (item) {
              return item.toData().permissionCode;
            });
            this.permissionSetDS.setQueryParameter('level', level);
            this.permissionSetDS.query();
            this.openAddPermissionSetModal({
              permissionCodes: permissionCodes,
              level: level,
              checkState: tableDS.selected[0].toData().checkState
            }, 'patch');
          } else {
            notification.warning({
              message: intl.get('ciam.missPermission.message.missPermission.sameLevel').d('请选择同一权限层级的项！')
            });
          }
        } else {
          notification.warning({
            message: intl.get('cpaas.common.notification.noAddPermission').d('请选择未添加权限的项！')
          });
        }
      } else {
        notification.warning({
          message: intl.get('ciam.missPermission.message.mp.choosePermissionItem').d('请选择需要添加权限的项！')
        });
      }
    } // 确认批量添加权限集

  }, {
    key: "handlePatchPermissionOk",
    value: function () {
      var _handlePatchPermissionOk = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(record) {
        var checkState, permissionCodes, level, menuIds, res;
        return _regeneratorRuntime.wrap(function _callee$(_context) {
          while (1) {
            switch (_context.prev = _context.next) {
              case 0:
                if (!(this.permissionSetDS.selected.length !== 0)) {
                  _context.next = 8;
                  break;
                }

                checkState = record.checkState, permissionCodes = record.permissionCodes, level = record.level;
                menuIds = this.permissionSetDS.selected.map(function (item) {
                  return item.toData().id;
                });
                _context.next = 5;
                return patchAddPermissionInterface({
                  level: level,
                  checkState: checkState,
                  menuIds: menuIds,
                  permissionCodes: permissionCodes,
                  permissionType: 'PERMISSION'
                });

              case 5:
                res = _context.sent;

                if (res && res.failed) {
                  notification.error({
                    message: res.message
                  });
                } else if (res && !res.failed) {
                  notification.success({
                    message: intl.get('cpaas.common.notification.success').d('操作成功')
                  });
                  this.props.tableDS.query();
                }

                return _context.abrupt("return", true);

              case 8:
                notification.warning({
                  message: intl.get('ciam.missPermission.message.missPermission.choosePermission').d('请选择需要添加的权限！')
                });
                return _context.abrupt("return", false);

              case 10:
              case "end":
                return _context.stop();
            }
          }
        }, _callee, this);
      }));

      function handlePatchPermissionOk(_x) {
        return _handlePatchPermissionOk.apply(this, arguments);
      }

      return handlePatchPermissionOk;
    }()
    /**
     * 打开添加权限集模态框
     */

  }, {
    key: "openAddPermissionSetModal",
    value: function openAddPermissionSetModal(record) {
      var _this3 = this;

      var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';

      _Modal.open({
        key: 'add-permission-modal',
        title: intl.get('ciam.missPermission.model.missPermission.addPermissionSet').d('添加权限集'),
        destroyOnClose: true,
        style: {
          width: 700
        },
        children: /*#__PURE__*/React.createElement(_Table, {
          dataSet: this.permissionSetDS,
          columns: this.permissionSetColumns,
          style: {
            height: 380
          },
          queryFieldsLimit: 2
        }),
        onOk: function onOk() {
          return type !== 'patch' ? _this3.handlePermissionOk(record) : _this3.handlePatchPermissionOk(record);
        },
        onCancel: function onCancel() {
          return true;
        },
        afterClose: function afterClose() {
          _this3.permissionSetDS.reset();

          _this3.permissionSetDS.unSelectAll();

          _this3.permissionSetDS.clearCachedSelected();

          _this3.permissionSetDS.queryDataSet.reset();
        }
      });
    }
    /**
     * 清理缺失权限记录
     */

  }, {
    key: "handleClearPermissionRecord",
    value: function handleClearPermissionRecord() {
      var _this4 = this;

      this.clearPermissionRecordFormDS.create({});

      _Modal.open({
        title: intl.get('ciam.missPermission.view.title.clearPermissionRecord').d('清理缺失权限记录'),
        drawer: true,
        width: 520,
        children: /*#__PURE__*/React.createElement(_Form, {
          dataSet: this.clearPermissionRecordFormDS
        }, /*#__PURE__*/React.createElement(_Select, {
          name: "checkType"
        }), /*#__PURE__*/React.createElement(_Select, {
          name: "clearType"
        })),
        onOk: function () {
          var _onOk = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
            var _this4$clearPermissio, _this4$clearPermissio2, checkType, _this4$clearPermissio3, clearType, res;

            return _regeneratorRuntime.wrap(function _callee2$(_context2) {
              while (1) {
                switch (_context2.prev = _context2.next) {
                  case 0:
                    _context2.next = 2;
                    return _this4.clearPermissionRecordFormDS.validate();

                  case 2:
                    if (!_context2.sent) {
                      _context2.next = 9;
                      break;
                    }

                    _this4$clearPermissio = _this4.clearPermissionRecordFormDS.current.toData(), _this4$clearPermissio2 = _this4$clearPermissio.checkType, checkType = _this4$clearPermissio2 === void 0 ? null : _this4$clearPermissio2, _this4$clearPermissio3 = _this4$clearPermissio.clearType, clearType = _this4$clearPermissio3 === void 0 ? null : _this4$clearPermissio3;
                    _context2.next = 6;
                    return clearPermissionRecordInterface({
                      checkType: checkType,
                      clearType: clearType
                    });

                  case 6:
                    res = _context2.sent;

                    if (res && res.failed) {
                      notification.error({
                        message: res.message
                      });
                    } else if (res && !res.failed) {
                      notification.success({
                        message: intl.get('cpaas.common.notification.success').d('操作成功')
                      });

                      _this4.props.tableDS.query();
                    }

                    return _context2.abrupt("return", res);

                  case 9:
                    return _context2.abrupt("return", false);

                  case 10:
                  case "end":
                    return _context2.stop();
                }
              }
            }, _callee2);
          }));

          function onOk() {
            return _onOk.apply(this, arguments);
          }

          return onOk;
        }(),
        onCancel: function onCancel() {
          return true;
        },
        afterClose: function afterClose() {
          return _this4.clearPermissionRecordFormDS.reset();
        }
      });
    } // 切换状态

  }, {
    key: "handleChangeCheckState",
    value: function handleChangeCheckState(value) {
      if (value === 'PERMISSION_MISMATCH') {
        this.props.checkStatusFormDS.buttonRefreshFlag = true;
        this.props.checkStatusFormDS.buttonAddPermissionFlag = false;
        this.props.checkStatusFormDS.buttonMenuRefreshFlag = false;
        this.setState({
          buttonRefreshFlag: true,
          buttonAddPermissionFlag: false,
          buttonMenuRefreshFlag: false
        });
      } else if (value === 'PERMISSION_NOT_PASS') {
        this.props.checkStatusFormDS.buttonRefreshFlag = false;
        this.props.checkStatusFormDS.buttonAddPermissionFlag = true;
        this.props.checkStatusFormDS.buttonMenuRefreshFlag = false;
        this.setState({
          buttonRefreshFlag: false,
          buttonAddPermissionFlag: true,
          buttonMenuRefreshFlag: false
        });
      } else if (value === 'PERMISSION_MENU_MISMATCH') {
        this.props.checkStatusFormDS.buttonRefreshFlag = false;
        this.props.checkStatusFormDS.buttonAddPermissionFlag = false;
        this.props.checkStatusFormDS.buttonMenuRefreshFlag = true;
        this.setState({
          buttonRefreshFlag: false,
          buttonAddPermissionFlag: false,
          buttonMenuRefreshFlag: true
        });
      } else {
        this.props.checkStatusFormDS.buttonRefreshFlag = false;
        this.props.checkStatusFormDS.buttonAddPermissionFlag = false;
        this.props.checkStatusFormDS.buttonMenuRefreshFlag = false;
        this.setState({
          buttonRefreshFlag: false,
          buttonAddPermissionFlag: false,
          buttonMenuRefreshFlag: false
        });
      }

      this.props.tableDS.query();
    } // 页面更多查询切换

  }, {
    key: "handleMoreSearchItem",
    value: function handleMoreSearchItem() {
      var moreSearchFlag = this.state.moreSearchFlag;
      this.setState({
        moreSearchFlag: !moreSearchFlag
      });
    } // 重置

  }, {
    key: "handleReset",
    value: function handleReset() {
      if (this.props.searchFormDS.current) {
        this.props.searchFormDS.current.reset();
      }
    } // 权限缺失查询查询

  }, {
    key: "handleSearch",
    value: function handleSearch() {
      this.props.tableDS.query();
    } // 点击批量刷新权限

  }, {
    key: "handleRefresh",
    value: function () {
      var _handleRefresh = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
        var tableDS, tempFlag, serviceNameSet, res;
        return _regeneratorRuntime.wrap(function _callee3$(_context3) {
          while (1) {
            switch (_context3.prev = _context3.next) {
              case 0:
                tableDS = this.props.tableDS;

                if (!(tableDS.selected.length !== 0)) {
                  _context3.next = 14;
                  break;
                }

                tempFlag = tableDS.selected.map(function (item) {
                  return item.toData().handleStatus;
                }).includes('PROCESSED');

                if (tempFlag) {
                  _context3.next = 11;
                  break;
                }

                serviceNameSet = tableDS.selected.map(function (item) {
                  return item.toData().serviceName;
                });
                _context3.next = 7;
                return refreshPermissionSet(serviceNameSet);

              case 7:
                res = _context3.sent;

                if (res && res.failed) {
                  notification.error({
                    message: res.message
                  });
                } else if (res && !res.failed) {
                  notification.success({
                    message: intl.get('cpaas.common.notification.success').d('操作成功')
                  });
                  tableDS.query();
                }

                _context3.next = 12;
                break;

              case 11:
                notification.warning({
                  message: intl.get('cpaas.common.notification.noFresh').d('请选择未刷新的项！')
                });

              case 12:
                _context3.next = 15;
                break;

              case 14:
                notification.warning({
                  message: intl.get('ciam.missPermission.view.message.chooseServiceItems').d('请选择需要刷新的服务项！')
                });

              case 15:
              case "end":
                return _context3.stop();
            }
          }
        }, _callee3, this);
      }));

      function handleRefresh() {
        return _handleRefresh.apply(this, arguments);
      }

      return handleRefresh;
    }() // 点击批量刷新权限

  }, {
    key: "handleMenuRefresh",
    value: function () {
      var _handleMenuRefresh = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
        var tableDS, processedFlag, serviceNameSet, obj, res;
        return _regeneratorRuntime.wrap(function _callee4$(_context4) {
          while (1) {
            switch (_context4.prev = _context4.next) {
              case 0:
                tableDS = this.props.tableDS;

                if (!(tableDS.selected.length !== 0)) {
                  _context4.next = 15;
                  break;
                }

                processedFlag = tableDS.selected.map(function (item) {
                  return item.toData().handleStatus;
                }).includes('PROCESSED');

                if (processedFlag) {
                  _context4.next = 12;
                  break;
                }

                // const levelSet = tableDS.selected.map(item => item.toData().fdLevel);
                // const level = levelSet[0];
                // const tempFlag = levelSet.every(item => item === level);
                // if (tempFlag) {
                // const typeSet = tableDS.selected.map(item => item.toData().permissionType);
                // const type = typeSet[0];
                // const typeFlag = typeSet.every(item => item === type);
                // if (typeFlag) {
                serviceNameSet = tableDS.selected.map(function (item) {
                  return item.toData();
                });
                obj = {
                  // level: serviceNameSet[0].fdLevel,
                  permissionCodes: serviceNameSet.map(function (item) {
                    return item.permissionCode;
                  }) // menuIds: serviceNameSet.map(item => item.menuId),
                  // permissionType: 'PERMISSION',

                };
                _context4.next = 8;
                return refreshMenuPermissionSet(obj);

              case 8:
                res = _context4.sent;

                if (res && res.failed) {
                  notification.error({
                    message: res.message
                  });
                } else if (res && !res.failed) {
                  notification.success({
                    message: intl.get('cpaas.common.notification.success').d('操作成功')
                  });
                  tableDS.query();
                } // } else {
                //   notification.warning({
                //     message: intl
                //       .get('ciam.missPermission.message.missPermission.sameType')
                //       .d('请选择同一权限类型的项！'),
                //   });
                // }
                // } else {
                //   notification.warning({
                //     message: intl
                //       .get('ciam.missPermission.message.missPermission.sameLevel')
                //       .d('请选择同一权限层级的项！'),
                //   });
                // }


                _context4.next = 13;
                break;

              case 12:
                notification.warning({
                  message: intl.get('cpaas.common.notification.noFresh').d('请选择未刷新的项！')
                });

              case 13:
                _context4.next = 16;
                break;

              case 15:
                notification.warning({
                  message: intl.get('ciam.missPermission.view.message.chooseServiceItems').d('请选择需要刷新的服务项！')
                });

              case 16:
              case "end":
                return _context4.stop();
            }
          }
        }, _callee4, this);
      }));

      function handleMenuRefresh() {
        return _handleMenuRefresh.apply(this, arguments);
      }

      return handleMenuRefresh;
    }()
  }, {
    key: "render",
    value: function render() {
      var _this$props2 = this.props,
          searchFormDS = _this$props2.searchFormDS,
          tableDS = _this$props2.tableDS,
          path = _this$props2.match.path;
      var _this$state = this.state,
          moreSearchFlag = _this$state.moreSearchFlag,
          buttonRefreshFlag = _this$state.buttonRefreshFlag,
          buttonAddPermissionFlag = _this$state.buttonAddPermissionFlag,
          buttonMenuRefreshFlag = _this$state.buttonMenuRefreshFlag;
      return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Header, {
        title: intl.get('ciam.missPermission.view.title.missPermissionControl').d('缺失权限管理')
      }, /*#__PURE__*/React.createElement(ButtonPermission, {
        type: "c7n-pro",
        permissionList: [{
          code: "".concat(path, ".button.clearPermissionRecord"),
          type: 'button',
          meaning: '缺失权限-清理缺失权限记录'
        }],
        className: styles['customize-button-style'],
        icon: "delete",
        onClick: this.handleClearPermissionRecord
      }, intl.get('ciam.missPermission.view.title.clearPermissionRecord').d('清理缺失权限记录')), /*#__PURE__*/React.createElement(_Select, {
        dataSet: this.props.checkStatusFormDS,
        name: "checkState",
        style: {
          width: '210px'
        },
        placeholder: intl.get('ciam.missPermission.view.message.chooseStatus').d('请选择状态'),
        onChange: this.handleChangeCheckState
      })), /*#__PURE__*/React.createElement(Content, null, /*#__PURE__*/React.createElement(_Row, {
        type: "flex",
        className: "c7n-form-line-with-btn"
      }, /*#__PURE__*/React.createElement(_Col, {
        span: 18
      }, /*#__PURE__*/React.createElement(_Form, {
        dataSet: searchFormDS,
        columns: 3
      }, /*#__PURE__*/React.createElement(_Select, {
        name: "permissionType"
      }), /*#__PURE__*/React.createElement(_Select, {
        name: "fdLevel"
      }), /*#__PURE__*/React.createElement(_Select, {
        name: "handleStatus"
      }))), /*#__PURE__*/React.createElement(_Col, {
        span: 6,
        className: "c7n-form-btn",
        style: {
          display: 'flex',
          justifyContent: 'flex-end'
        }
      }, /*#__PURE__*/React.createElement("div", {
        style: {
          // marginTop: '10px',
          flexShrink: 0,
          display: 'flex',
          alignItems: 'center'
        }
      }, /*#__PURE__*/React.createElement(_Button, {
        onClick: this.handleMoreSearchItem
      }, intl.get('cpaas.common.button.viewMore').d('更多查询')), /*#__PURE__*/React.createElement(_Button, {
        onClick: this.handleReset
      }, intl.get('cpaas.common.button.reset').d('重置')), /*#__PURE__*/React.createElement(_Button, {
        color: "primary",
        onClick: this.handleSearch
      }, intl.get('cpaas.common.button.search').d('查询')))), /*#__PURE__*/React.createElement(_Col, {
        span: 18
      }, /*#__PURE__*/React.createElement(_Form, {
        dataSet: searchFormDS,
        columns: 3
      }, moreSearchFlag ? /*#__PURE__*/React.createElement(_Lov, {
        name: "serviceNameLov",
        onEnterDown: this.handleTenantEnter
      }) : null, moreSearchFlag ? /*#__PURE__*/React.createElement(_TextField, {
        name: "menuName",
        onEnterDown: this.handleTenantEnter
      }) : null, moreSearchFlag ? /*#__PURE__*/React.createElement(_TextField, {
        name: "apiPath",
        onEnterDown: this.handleTenantEnter
      }) : null, moreSearchFlag ? /*#__PURE__*/React.createElement(_Select, {
        name: "apiMethod"
      }) : null))), /*#__PURE__*/React.createElement(_Row, {
        type: "flex",
        justify: "end",
        style: {
          marginBottom: 14
        }
      }, /*#__PURE__*/React.createElement(_Col, {
        offset: 12
      }, buttonRefreshFlag ? /*#__PURE__*/React.createElement(ButtonPermission, {
        type: "c7n-pro",
        permissionList: [{
          code: "".concat(path, ".button.refreshPermission"),
          type: 'button',
          meaning: '缺失权限-刷新权限'
        }],
        icon: "sync",
        className: styles['customize-button-style'],
        onClick: this.handleRefresh
      }, intl.get('ciam.missPermission.view.button.refreshPermission').d('刷新权限')) : null, buttonAddPermissionFlag ? /*#__PURE__*/React.createElement(ButtonPermission, {
        type: "c7n-pro",
        permissionList: [{
          code: "".concat(path, ".button.addPermissionSet"),
          type: 'button',
          meaning: '缺失权限-添加权限集'
        }],
        className: styles['customize-button-style'],
        icon: "add",
        onClick: this.handlePatchAddPermissionSet
      }, intl.get('ciam.missPermission.view.button.addPermissionSet').d('添加权限集')) : null, buttonMenuRefreshFlag ? /*#__PURE__*/React.createElement(ButtonPermission, {
        type: "c7n-pro",
        permissionList: [{
          code: "".concat(path, ".button.refreshMenuPermission"),
          type: 'button',
          meaning: '缺失权限-刷新菜单权限'
        }],
        icon: "sync",
        className: styles['customize-button-style'],
        onClick: this.handleMenuRefresh
      }, intl.get('ciam.missPermission.view.button.refreshPermission').d('刷新权限')) : null)), /*#__PURE__*/React.createElement(_Table, {
        dataSet: tableDS,
        columns: this.columns
      })));
    }
  }]);

  return MissPermissionRecord;
}(React.Component), (_applyDecoratedDescriptor(_class2.prototype, "handleDetail", [_dec3], Object.getOwnPropertyDescriptor(_class2.prototype, "handleDetail"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "handlePatchAddPermissionSet", [_dec4], Object.getOwnPropertyDescriptor(_class2.prototype, "handlePatchAddPermissionSet"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "handlePatchPermissionOk", [_dec5], Object.getOwnPropertyDescriptor(_class2.prototype, "handlePatchPermissionOk"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "openAddPermissionSetModal", [_dec6], Object.getOwnPropertyDescriptor(_class2.prototype, "openAddPermissionSetModal"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "handleClearPermissionRecord", [_dec7], Object.getOwnPropertyDescriptor(_class2.prototype, "handleClearPermissionRecord"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "handleChangeCheckState", [_dec8], Object.getOwnPropertyDescriptor(_class2.prototype, "handleChangeCheckState"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "handleMoreSearchItem", [_dec9], Object.getOwnPropertyDescriptor(_class2.prototype, "handleMoreSearchItem"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "handleReset", [_dec10], Object.getOwnPropertyDescriptor(_class2.prototype, "handleReset"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "handleSearch", [_dec11], Object.getOwnPropertyDescriptor(_class2.prototype, "handleSearch"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "handleRefresh", [_dec12], Object.getOwnPropertyDescriptor(_class2.prototype, "handleRefresh"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "handleMenuRefresh", [_dec13], Object.getOwnPropertyDescriptor(_class2.prototype, "handleMenuRefresh"), _class2.prototype)), _class2)) || _class) || _class) || _class);
export { MissPermissionRecord as default };